package com.kantboot.business.bp.service.impl;

import com.kantboot.business.bp.domain.entity.BusBpGrade;
import com.kantboot.business.bp.repository.BusBpGradeRepository;
import com.kantboot.business.bp.service.IBusBpGradeService;
import com.kantboot.system.user.domain.entity.SysUser;
import com.kantboot.util.core.param.PageParam;
import com.kantboot.util.core.result.PageResult;
import jakarta.annotation.Resource;
import org.springframework.data.domain.Page;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class BusBpGradeServiceImpl implements IBusBpGradeService {

    @Resource
    private BusBpGradeRepository repository;

    @Override
    public List<BusBpGrade> getAll() {
        return repository.findAll();
    }

    @Override
    public PageResult getBodyData(PageParam<SysUser> param) {
        Page<BusBpGrade> bodyData = repository.getBodyData(param.getPageable());
        return PageResult.of(bodyData);
    }
}
